package com.itlong.cloud.property.dao;

import com.itlong.cloud.POJO.PO.ElevatorMealInfoPO;
import com.itlong.cloud.POJO.VO.app.AppElevatorMealInfoVO;
import com.itlong.cloud.POJO.VO.property.PropertyMealManageGetVO;
import com.itlong.cloud.POJO.VO.property.PropertyWithdrawVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      共享电梯套餐管理数据访问接口。
 * <desc/>
 *
 * @createDate 2020/07/15
 */
@Mapper
@Repository
public interface IPropertyMealManageDao {

    /**
     * <desc>
     *      共享电梯套餐信息分页查询。
     * <desc/>
     *
     * @param  param
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    List<PropertyMealManageGetVO> getMealManageByPage(Map<String, Object> param);

    /**
     * <desc>
     *      共享电梯套餐信息总记录数。
     * <desc/>
     *
     * @param  param
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    Integer getMealManagePageCount(Map<String, Object> param);

    /**
     * <desc>
     *     新增共享电梯套餐
     * <desc/>
     *
     * @param  params  收费规则信息
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    Integer saveMealManageInfo(Map<String,Object> params);

    /**
     * <desc>
     *     新增共享电梯套餐
     * <desc/>
     *
     * @param  mealId   套餐id
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    PropertyMealManageGetVO getMealManageDetail(String mealId);

    /**
     * <desc>
     *      查询套餐是否使用
     * <desc/>
     *
     * @param mealId 套餐编号
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    Integer checkMeal(String mealId);

    /**
     * <desc>
     *      删除套餐
     * <desc/>
     *
     * @param mealId 套餐编号
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    Integer deleteMealManageInfo(String mealId);

    /**
     * <desc>
     *     更新共享电梯套餐
     * <desc/>
     *
     * @param  params
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    Integer updateMealManageInfo(Map<String,Object> params);

    /**
     * <desc>
     *     根据替换目标查询出其中间所有数据
     * <desc/>
     *
     * @param  startMealId  开始套餐编号
     * @param  endMealId  结束套餐编号
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    List<ElevatorMealInfoPO> getMealManageInfoAfterMealId(@Param("startMealId") String startMealId, @Param("endMealId")String endMealId);

    /**
     * <desc>
     *     根据套餐编号更新ID
     * <desc/>
     *
     * @param  mealId  套餐编号
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    Integer updateIdByMealIdAdd(@Param("mealId")String mealId);

    /**
     * <desc>
     *     根据套餐编号更新ID
     * <desc/>
     *
     * @param  mealId  套餐编号
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    Integer updateIdByMealIdSubtract(@Param("mealId")String mealId);

    /**
     * <desc>
     *     删除套餐
     * <desc/>
     *
     * @param  mealId  套餐编号
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    Integer deleteMealManageByMealId(@Param("mealId")String mealId);

    /**
     * <desc>
     *      APP获取乘梯缴费套餐列表
     * <desc/>
     *
     * @param projectId 项目编号
     * @param roomId 房间编号
     * @return
     * @author Qiang.S
     * @createDate 2020/07/15
     */
    List<AppElevatorMealInfoVO> getMealManageByProjectId(@Param("projectId") String projectId, @Param("roomId") String roomId);

}
